Skip to content

Conversation

@theghost5800
Copy link
Contributor

No description provided.

JIRA:LMCROSSITXSADEPLOY-3320
@theghost5800 theghost5800 marked this pull request as ready for review October 14, 2025 13:26
configuration.setDefaultMailClient(flowableMailClient);
configuration.setDatabaseSchemaUpdate("create-drop");
configuration.setBeans(Map.of("testVariableTask", testVariableTask));
configuration.setAsyncExecutorActivate(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the async executor turned off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was generated by the chat in order to keep the test single threaded but even when this line is removed, the test is still single thread. So we can remove this configuration.


@Test
void testProcessWithPredefinedVariables() {
String correlationId = UUID.randomUUID()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of boilerplate for building test data (createBigDeploymentDescriptor, etc.) makes the class huge.
Suggestion: extract TestFixtures (factory classes or builders) into a separate test utility

// This assertion intentionally checks that the modified deployment descriptor is different from the initially set one because of flowable caching regression
// https://github.com/flowable/flowable-engine/issues/4130
// The original behaviour must be to have same deployment descriptor as it was set in the task. Modify the test to assert for matching values when the issue is fixed.
assertNotEquals(JsonUtil.toJson(modifiedBigDeploymentDescriptor), JsonUtil.toJson(retrievedBigDeploymentDescriptor));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd, why do we need to create a test case to check a bug/regression, do you think that we can add it with assertEquals and comment it until a fix is provided?

Copy link
Contributor Author

@theghost5800 theghost5800 Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will remind us to fix the test when new version of flowable is adopted and fix is available and also remove custom added workaround in FlowableConfiguration class.

Map<String, Object> initialVariables = new HashMap<>();
setSerializedValueInMap(initialVariables, Variables.CORRELATION_ID, correlationId);
setSerializedValueInMap(initialVariables, Variables.DELETE_SERVICES, deleteServices);
setSerializedValueInMap(initialVariables, Variables.MTA_ID, mtaId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core logic of the tests is ~20 lines you may think of extracting the assertions and the setup in separate utilities for more readable tests.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@theghost5800 theghost5800 merged commit 4e0a249 into master Oct 23, 2025
7 of 8 checks passed
@theghost5800 theghost5800 deleted the addFlowableTests branch October 23, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants